/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * ScenePanel.java
 *
 * Created on 2008-07-25, 06:35:32
 */

package pl.edu.amu.wmi.kino.visualjavafx.visualjavafxgui.editor.visual;

import java.awt.dnd.DropTarget;
import javax.swing.JComponent;
import org.openide.windows.TopComponent;

/**
 *
 * @author psychollek
 */
public class ScenePanel extends javax.swing.JPanel {

    private JComponent sceneView;

    /** Creates new form ScenePanel */
    public ScenePanel(VisualScene scene) {
        initComponents();
        sceneView = scene.getView();
        this.scenePane.setViewportView(sceneView);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        scenePane = new javax.swing.JScrollPane();

        setLayout(new java.awt.BorderLayout());
        add(scenePane, java.awt.BorderLayout.CENTER);
    }// </editor-fold>//GEN-END:initComponents


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JScrollPane scenePane;
    // End of variables declaration//GEN-END:variables

    public int getPresistanceType(){
        return TopComponent.PERSISTENCE_ONLY_OPENED;
    }

    @Override
    public void setDropTarget(DropTarget dt){
        sceneView.setDropTarget(dt);
    }


}
